using System;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Hosting;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using System.IO;
using Microsoft.AspNetCore.StaticFiles;

namespace BookShareWebApp
{
    public class BookController : Controller
    {
        private readonly BookContext _bookcontext;

        public BookController(BookContext bookcontext)
        {
            _bookcontext = bookcontext;
        }

         [HttpGet("/api/books")]
        public IEnumerable<Book> GetAll() {
            
            IEnumerable<Book> list =_bookcontext.Book.ToList();

            return list;  
        }
         [HttpGet("/api/book/{id}")]
        public Book getBookById(int id) {
            Book book = new Book();

            
            return book;
            
        }
   

    }
}
